<?php 

namespace app\admin\controller;
use app\admin\controller\Base;
use app\admin\model\Resourcebools;
use think\Request;

class Resourceboolss extends Base
{
	//新资源
	public function newpool()
	{
	    //查询所有资源
		$res=Resourcebools::select();
		//查询所有的咨询师
        $zxs =
		//发送到视图的数据
		$data = array(
		    "res" => $res,
        );
		//加载视图
		return view("newpool",$data);

	}
	//添加新资源
	public function  addnew()
	{

	}
	//加载编辑表单
    public function update(Request $request){
	    $data = $request->get("id");
	    $res = Resourcebools::where(array('re_id'=>$data))->find();
	    $data = array(
	        "data"=>$res,
        );
	    return view("update",$data);
    }
    //执行编辑
    public function toupdate(Request $request){
	    $data = $request->post();

	    if(Resourcebools::update($data)){
	        $this->success("修改成功","Resourceboolss/newpool");
        }else{
	        $this->error("修改失败");
        }
    }
    //执行删除
    public function del(Request $request){
	    $id = $request->post("id");
	    if(Resourcebools::destroy($id)){
            $this->success("删除成功","Resourceboolss/newpool");
        }else{
            $this->error("删除失败");
        }
    }
    //执行转移
    public function signout(Request $request){
	    $parameter = $request->post();

	    //转移操作
        $res = "";
        if($res){
            $this->success("转移成功","Resourceboolss/newpool");
        }else{
            $this->error("转移失败");
        }

    }
	
}
